<!-- INCLUDE sv_overall_header.html -->

<!-- IF IN_FB_IFRAME -->
	<script type="text/javascript" src="../ofc/js/json/json2.js"></script>
	<script type="text/javascript" src="../ofc/js/swfobject.js"></script>
	<script type="text/javascript">
	
	swfobject.embedSWF("../ofc/open-flash-chart.swf", "my_chart", "680", "350", "9.0.0", "expressInstall.swf",  {"get-data":"get_data_1"} );
	</script>
<!-- ELSE -->
	<script type="text/javascript" src="ofc/js/json/json2.js"></script>
	<script type="text/javascript" src="ofc/js/swfobject.js"></script>
	<script type="text/javascript">
	
	swfobject.embedSWF("ofc/open-flash-chart.swf", "my_chart", "950", "550", "9.0.0", "expressInstall.swf",  {"get-data":"get_data_1"} );
	</script>
<!-- ENDIF -->
<script >

function follow(add) 
{	
	var strURL = '{S_FOLLOW_ACTION}';
	var xmlHttpReq = false;
    
    var self = this;
    
    
    
    // Mozilla/Safari
    if (window.XMLHttpRequest) 
	{
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
	{
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() 
	{
        if (self.xmlHttpReq.readyState == 4)
		{
			// get result back.
			var response = self.xmlHttpReq.responseText;
			
			num = parseInt(response, 10);

			// update follower number & text.
			update_follow_text();
			update_follower_num(num);
        }
    }
    self.xmlHttpReq.send(getquerystring(add));
}

function getquerystring(add) 
{
    var	followee_user_id = {S_QUERY_USER_ID};
	
    if (add == true)
    {
    	qstr = 'mode=add&followee_user_id=' + escape(followee_user_id);  // NOTE: no '?' before querystring
    	return qstr;
	}
	else
	{
		qstr = 'mode=remove&followee_user_id=' + escape(followee_user_id);  // NOTE: no '?' before querystring
    	return qstr;
	}
}

function update_follow_text(){
    document.getElementById("follow_text").innerHTML = '';
}

function update_follower_num(num)
{
	if (num != 0)
	{
		document.getElementById("follower_num").innerHTML = ' (' + num + ' {L_SV_FOLLOWER_NUM})';
	}
	else
	{
		document.getElementById("follower_num").innerHTML = ' ';
	}
}
</script>

<script >
function ofc_ready()
{
    //alert('ofc_ready');
}

function get_data_1()
{
    //alert( 'reading data' );
    return JSON.stringify(data);
}

function findSWF(movieName) {
  if (navigator.appName.indexOf("Microsoft")!= -1) {
    return window[movieName];
  } else {
    return document[movieName];
  }
}
    
var data = {JASON_STRING};

</script>




<div class="panel" > 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{U_QUERY_USERNAME} - {L_SV_PERFORMANCE}   
		<span id="follower_num"><!-- IF S_FOLLOWER_NUM ne 0 -->({S_FOLLOWER_NUM} {L_SV_FOLLOWER_NUM}) <!-- ENDIF --></span> 
		<span id="follow_text"> 
		<!-- IF S_USER_LOGGED_IN and S_USER_ID ne S_QUERY_USER_ID-->
			<!-- IF S_FOLLOWING --> <a href="#" onclick="follow(false);"> ({L_SV_CANCEL_FOLLOWER})</a> 
			<!-- ELSE --> <a href="#" onclick="follow(true);"> ({L_SV_FOLLOW})</a> 
			<!-- ENDIF --> 
		<!-- ENDIF --> 
		</span> 
	</h2> 	
	</div>
<!-- IF S_PERFORMANCE  -->

	<!-- IF SHOW_1_MONTH_ROI -->
	<table border="0" cellpadding="5" cellspacing="5">
		
		<tr>
			<td><p>{L_SV_ROI_LAST_1_MONTH}</p></td>
			<td><p>{S_ROI_1_MONTH}%</p></td>
		</tr>
		
		<!-- IF SHOW_3_MONTH_ROI -->
		<tr>
			<td><p>{L_SV_ROI_LAST_3_MONTH}</p></td>
			<td><p>{S_ROI_3_MONTH}%</p></td>
		</tr>
		<!-- ENDIF -->	
		<!-- IF SHOW_6_MONTH_ROI -->
		<tr>
			<td><p>{L_SV_ROI_LAST_6_MONTH}</p></td>
			<td><p>{S_ROI_6_MONTH}%</p></td>
		</tr>
		<!-- ENDIF -->	
		<!-- IF SHOW_12_MONTH_ROI -->
		<tr>
			<td><p>{L_SV_ROI_LAST_12_MONTH}</p></td>
			<td><p>{S_ROI_12_MONTH}%</p></td>
		</tr>
		<!-- ENDIF -->	
		
	</table>
	<!-- ENDIF -->	
	
<div id="my_chart"></div>
<!-- ELSE -->
{L_SV_NO_PERFORMANCE}
<!-- ENDIF -->
</div>

<!-- INCLUDE holding_stock_list.html -->

<div class="panel" > 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{U_QUERY_USERNAME} - {L_SV_HISTORY}</h2> 
	</div>
	<!-- IF S_LIST  -->
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>
			<td><p>{L_SV_TYPE}</p></td>
			<td><p>{L_SV_STOCK_ID}</p></td>
			<td><p>{L_SV_CORP_NAME}</p></td>
			<td><p>{L_SV_NUMBER}</p></td>
			<td><p>{L_SV_REQUEST_TIME}</p></td>
			<td><p>{L_SV_DEAL_TIME}</p></td>
			<td><p>{L_SV_PRICE}</p></td>
			<td><p>{L_SV_NOTE}</p></td>
		</tr>
		<!-- BEGIN list -->
		<tr>
			<td><p>
			<!-- IF list.ACTION eq buy -->     {L_SV_ACTION_BUY}    <!-- ENDIF -->
			<!-- IF list.ACTION eq sell -->    {L_SV_ACTION_SELL}     <!-- ENDIF -->
			<!-- IF list.ACTION eq to_buy -->  {L_SV_ACTION_TO_BUY}      <!-- ENDIF -->
			<!-- IF list.ACTION eq to_sell --> {L_SV_ACTION_TO_SELL}       <!-- ENDIF -->			
			<!-- IF list.ACTION eq to_buy_deleted -->  {L_SV_ACTION_TO_BUY_DELETED}      <!-- ENDIF -->
			<!-- IF list.ACTION eq to_sell_deleted --> {L_SV_ACTION_TO_SELL_DELETED}       <!-- ENDIF -->			
			</p></td>
			<td><p>{list.CORP_ID}</p></td>
			<td><p><a href=" http://mops.twse.com.tw/mops/web/t146sb03?step=1&firstin=1&off=1&keyword4=&code1=&TYPEK2=&checkbtn=&queryName=co_id&TYPEK=all&isnew=true&co_id={list.CORP_ID}" target=blank>{list.CORP_NAME}</a></p></td>
			<td><p>{list.NUMBER}</p></td>
			<td><p>{list.REQUEST_TIME}</p></td>
			<td><p><!-- IF list.DEAL_TIME eq 0 -->   {L_SV_DEAL_NOT_DONE}   <!-- ELSE -->    {list.DEAL_TIME}      <!-- ENDIF --></p></td>
			<td><p><!-- IF list.PRICE eq 0 -->   --   <!-- ELSE -->    {list.PRICE}      <!-- ENDIF --></p></td>
			<td><p>{list.NOTE}</p></td>
		</tr>
		<!-- END list -->
	</table>
	<!-- ELSE -->
	{L_SV_NO_HISTORY}
	<!-- ENDIF -->
</div>


<div class="panel" > 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{L_SV_EQUITY_CHANGE_LOG}</h2> 
	</div>
	<!-- IF S_EQUITY_CHANGE_LIST  -->
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>			
			<td><p>{L_SV_SCHEDULED_DATE}</p></td>
			<td><p>{L_SV_EXECUTION_DATE}</p></td>
			<td><p>{L_SV_STOCK_ID}</p></td>
			<td><p>{L_SV_CORP_NAME}</p></td>
			<td><p>{L_SV_SHARE_BEFORE_CHANGE}</p></td>
			<td><p>{L_SV_DISPATCHED_CASH}</p></td>
			<td><p>{L_SV_SHARE_AFTER_CHANGE}</p></td>
			
		</tr>
		<!-- BEGIN equity_change_log_list -->
		<tr>
			<td><p>{equity_change_log_list.SCHEDULED_DATE}</p></td>
			<td><p>{equity_change_log_list.EXECUTION_DATE}</p></td>
			<td><p>{equity_change_log_list.CORP_ID}</p></td>
			<td><p>{equity_change_log_list.CORP_NAME}</p></td>
			<td><p>{equity_change_log_list.SHARE}</p></td>
			<td><p>{equity_change_log_list.USER_GET_CASH_AFTER_CHANGE}</p></td>
			<td><p>
				<!-- IF equity_change_log_list.CORP_ID == equity_change_log_list.USER_GET_CORP_ID_AFTER_CHANGE  -->
				{equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE}
				<!-- ELSE -->
				{equity_change_log_list.CORP_NAME_AFTER_CHANGE}({equity_change_log_list.USER_GET_CORP_ID_AFTER_CHANGE}) {equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE} {L_SV_SHARE}
				<!-- ENDIF -->
				<!-- IF equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE_2 != 0  -->
				, {L_SV_DISPATCH_IN_ADDITION} {equity_change_log_list.CORP_NAME_AFTER_CHANGE_2}({equity_change_log_list.USER_GET_CORP_ID_AFTER_CHANGE_2}) {equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE_2} {L_SV_SHARE}
				<!-- ENDIF -->
				<!-- IF equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE_3 != 0  -->
				,  {equity_change_log_list.CORP_NAME_AFTER_CHANGE_3}({equity_change_log_list.USER_GET_CORP_ID_AFTER_CHANGE_3}) {equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE_3} {L_SV_SHARE}
				<!-- ENDIF -->
			</p></td>
			
		</tr>
		<!-- END equity_change_log_list -->
	</table>
	<!-- ELSE -->
	{L_SV_NO_HISTORY}
	<!-- ENDIF -->
</div>

<!-- INCLUDE sv_overall_footer.html -->